<?php
/**
 * User: aka
 * Time: 23:01
 */

namespace app\tenno\model;

use think\Model;

class ClanActivity extends Model
{
    public function scopeDeleteState($query, $deleteState)
    {
        $query->where('delete_state', '=', $deleteState)
            ->field('delete_time, delete_state', true)
            ->order('create_time','desc');
    }

    public function scopeContent($query, $deleteState, $activityId)
    {
        $query->where(['delete_state' => $deleteState, 'id' => $activityId])
            ->field('delete_time, delete_state', true);
    }

    public function scopeUid($query, $uid)
    {
        $query->where('uid', '=', $uid);
    }
}